package com.hoshiicloud.common.feign.fallback;

import com.hoshiicloud.common.feign.BaseIdGeneratorService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * 公司微服务FeignClient熔断器
 *
 * @author : yangcheng
 * @date : 2019/5/6
 **/
@Component
public class BaseHystrixIdGeneratorFeignFallback implements FallbackFactory<BaseIdGeneratorService> {

    @Override
    public BaseIdGeneratorService create(Throwable cause) {

        return new BaseIdGeneratorService() {
            @Override
            public String queryGeneratorId() {
                return null;
            }

            @Override
            public Set<String> queryGeneratorIds(Integer count) {
                return null;
            }
        };
    }

}
